<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/taglibs.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="StyleSheet" type="text/css" href="<%=request.getContextPath()%>/pages/css/common.css"></link>
<title>DFASS</title>
</head>
<body>
	<div class="headerContent" align="center">
		<div class="header">
		<%@ include file="/pages/inc/logged_top.jsp" %>			
		</div>
		<div id="nav_container" align="center">
		<%@ include file="/pages/menu/menu_customer.jsp" %>
	    </div>
	</div>
	
	<div class="bodyContent" align="center">
		<table><tr><td>&nbsp;</td></tr></table>
		<s:form theme="simple">
			<!-- This Empty Table is Required before the content of the body -->
			<table class="tblAdminNormal">
				<thead>
					<tr>
						<td colspan="7" width="800px" >Customer details</td>
					</tr>
				</thead>
			</table>		
 			<table class="userList">
				<thead>
					<tr height="30px">
			            <td width="119">First Name</td>
			            <td width="164">E-Mail</td>
			            <td width="121">Mobile No</td>
			            <td width="110">Username</td>
			            <td width="105">Status</td>
			            <td width="112">Action</td>
		            </tr>
		        </thead>
		        <tbody>
		        	<c:forEach var="u" items="${users}">
				        <tr>
							<td width="119">${u.fName}</td>
				            <td width="121">${u.email}</td>
				            <td width="110">${u.mobileNo}</td>
				            <td width="110">${u.username}</td>
				            
				            <c:choose>
					            <c:when test="${u.status == -1 }">
					            	<td width="105"><input type="text" class="inputLikeLabel" value="Pending" readonly="readonly" /></td>
					            </c:when>
					            <c:when test="${u.status == 0 }">
					            	<td width="105"><input type="text" class="inputLikeLabel" value="Active" readonly="readonly" /></td>
					            </c:when>
					            <c:when test="${u.status == 1 }">
					            	<td width="105"><input type="text" class="inputLikeLabel" value="Blocked" readonly="readonly" /></td>
					            </c:when>
					            <c:when test="${u.status == 2 }">
					            	<td width="105"><input type="text" class="inputLikeLabel" value="Deactive" readonly="readonly" /></td>
					            </c:when>
					            <c:otherwise>
					            	<td width="105"><input type="text" class="inputLikeLabel" value="Unknown" readonly="readonly" /></td>
					            </c:otherwise>
				            </c:choose>
				            <td width="112" align="center">
				            	<ul class="table_controls">
				                	<li><a href="viewUser?id=${u.userId }" tip="View User" class="tooltip"><img src="<%=request.getContextPath()%>/pages/images/common/ico_view.png" alt="View Order" /></a></li>
				                    <c:choose>
							            <c:when test="${u.status == 2 }">
					                    	<li ><a href="#"  tip="Edit User" class="tooltip"><img src="<%=request.getContextPath()%>/pages/images/common/ico_edit.png" alt="Edit User"  /></a></li>
							            </c:when>
							            <c:otherwise>
					                    	<li><a href="loadEditUserPage?id=${u.userId }" tip="Edit User" class="tooltip"><img src="<%=request.getContextPath()%>/pages/images/common/ico_edit.png" alt="Edit User" /></a></li>
							            </c:otherwise>
				                    </c:choose>
				                    <c:choose>
							            <c:when test="${u.status == 2 }">
						                    <li><a href="activateUser?id=${u.userId }" tip="Activate User" onclick="if (!confirm('Are you sure, you want to activate this user?')) return false" class="tooltip">
						                    		<img src="<%=request.getContextPath()%>/pages/images/common/ico_delete.png" alt="Activate User" /></a></li>
							            </c:when>
							            <c:otherwise>
						                    <li><a href="deleteUser?id=${u.userId }" tip="Delete User" onclick="if (!confirm('Are you sure, you want to delete this user?')) return false" class="tooltip">
						                    		<img src="<%=request.getContextPath()%>/pages/images/common/ico_delete.png" alt="Delete Order" /></a></li>
							            </c:otherwise>
				                    </c:choose>
		                		</ul>
							</td>
				        </tr>
		        	</c:forEach>
		        </tbody>
			</table>
		</s:form>
	</div>
	
	<div class="footerContent" align="center">
		<div class="footer">
			<%@ include file="/pages/inc/footer.jsp" %>
		</div>
	</div>
</body>
</html>